﻿<%@ Page Title="" Language="C#" MasterPageFile="ReconSite.Master" AutoEventWireup="true" CodeBehind="ReportWizard.aspx.cs" Inherits="Recon.Portal.WebUI.ReportWizard" %>

<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleHolder" runat="server">
    <title>Report Wizard</title>
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="BodyHolder" runat="server">
    <br />
    <div class="formDiv">
        <asp:Wizard ID="wzReportCreation" runat="server" HeaderText="Report Wizard"
            DisplayCancelButton="True" FinishCompleteButtonText="Show Report"
            OnFinishButtonClick="wzReportCreation_FinishButtonClick"
            OnNextButtonClick="wzReportCreation_NextButtonClick"
            OnPreviousButtonClick="wzReportCreation_PreviousButtonClick"
            OnCancelButtonClick="wzReportCreation_CancelButtonClick"
            ActiveStepIndex="2" BorderWidth="1px" BackColor="#EFF3FB" BorderColor="#B5C7DE" Font-Names="Verdana" Height="176px" Width="717px" Style="margin-top: 35px">
            <HeaderStyle BackColor="#284E98" BorderColor="#EFF3FB" BorderStyle="Solid" BorderWidth="2px" Font-Bold="True" Font-Size="0.9em" ForeColor="White" HorizontalAlign="Center" />
            <NavigationButtonStyle BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" />
            <SideBarButtonStyle BackColor="#507CD1" Font-Names="Verdana" ForeColor="White" />
            <SideBarStyle BackColor="#507CD1" Font-Size="0.9em" Width="150" VerticalAlign="Top" />
            <StepStyle Font-Size="0.8em" ForeColor="#333333" />
            <WizardSteps>
                <asp:WizardStep ID="Step1" Title="Report Details" StepType="Start">
                    <br />
                    <table cellpadding="5" cellspacing="5">
                        <tr>
                            <td style="font-size: small">Report Title:
                            </td>
                            <td>
                                <asp:TextBox ID="txtReportTitle" runat="server" MaxLength="30" />
                                <asp:RequiredFieldValidator ID="rqTitle" runat="server" ControlToValidate="txtReportTitle" ErrorMessage="Report Title is required." SetFocusOnError="True" Style="font-size: small" />
                            </td>
                        </tr>
                        <tr>
                            <td style="font-size: small">Customer:</td>
                            <td>
                                <asp:DropDownList ID="ddlCustomer" runat="server" DataTextField="CustomerName" DataValueField="CustomerID" /></td>
                        </tr>
                        <tr>
                            <td style="font-size: small">Remitter:</td>
                            <td>
                                <asp:DropDownList ID="ddlRemitter" runat="server" DataTextField="RemitterName" DataValueField="RemitterID" />
                            </td>
                        </tr>
                    </table>
                </asp:WizardStep>
                <asp:WizardStep ID="Step2" Title="Report Fields" StepType="Step">
                    <br />
                    <asp:RadioButtonList ID="rdChoice" runat="server" RepeatLayout="Flow" AutoPostBack="true" OnSelectedIndexChanged="rdChoice_SelectedIndexChanged" RepeatDirection="Horizontal" Style="font-size: small">
                        <asp:ListItem Text="Invoice" Value="I" />
                        <asp:ListItem Text="Statement" Value="S" />
                        <asp:ListItem Text="Both" Value="B" Enabled="False" />
                    </asp:RadioButtonList>
                    <asp:RequiredFieldValidator ID="rqChoice" runat="server" ControlToValidate="rdChoice" ErrorMessage="Choice is required." Display="Dynamic" SetFocusOnError="True" InitialValue="-1" />
                    <br />
                    <br />
                    <asp:Label ID="lblFieldText" Text="Fields:" runat="server" Style="font-size: small" Visible="false"></asp:Label>
                    <asp:CheckBox ID="chkSelectAllFields" runat="server" Text="All Fields" Style="azimuth: left; left: 0px;" onclick="SelectAllFields(this, 'chkFields')" />
                    <br />
                    <asp:CheckBoxList ID="chkFields" runat="server" RepeatDirection="Horizontal" RepeatColumns="4" />
                </asp:WizardStep>
                <asp:WizardStep ID="Step3" Title="Report Criteria" StepType="Finish">
                    <table border="0">
                        <tr>
                            <td style="font-size: small">From Date:</td>
                            <td>
                                <asp:TextBox ID="txtFromDate" runat="server" MaxLength="10" class="datepick" ReadOnly="True" />
                                <asp:CompareValidator ID="cmpFromDate" runat="server" ControlToValidate="txtFromDate" ErrorMessage="From Date should be in dd/mm/yyyy format." Visible="true" Operator="DataTypeCheck" Type="Date" />
                            </td>
                        </tr>
                        <tr>
                            <td style="font-size: small">To Date:</td>
                            <td>
                                <asp:TextBox ID="txtToDate" runat="server" MaxLength="10" class="datepick" ReadOnly="True" />
                                <asp:CompareValidator ID="cmpToDate" runat="server" ControlToValidate="txtToDate" Visible="true" ErrorMessage="To Date should be in dd/mm/yyyy format." Operator="DataTypeCheck" Type="Date" />
                            </td>
                        </tr>
                        <tr>
                            <td style="font-size: small" valign="top">Status:
                    <asp:CheckBox ID="chkSelectAllStatuses" runat="server" Text="All Statuses" Style="azimuth: left; left: 0px;" onclick="SelectAllFields(this, 'chkStatuses')" />
                            </td>
                            <td>
                                <asp:CheckBoxList ID="chkStatuses" runat="server" Style="font-size: small">
                                    <asp:ListItem Text="Authorized" Value="A" />
                                    <asp:ListItem Text="Matched" Value="M" />
                                    <asp:ListItem Text="Partially Matched" Value="P" />
                                    <asp:ListItem Text="Sent to Remitter" Value="S" />
                                    <asp:ListItem Text="Unmatched" Value="N" />
                                    <asp:ListItem Text="Uploaded" Value="U" />
                                </asp:CheckBoxList>
                            </td>
                        </tr>
                    </table>
                </asp:WizardStep>
            </WizardSteps>
        </asp:Wizard>
    </div>
    <br />
    <br />
    <br />
    <br />
    <script type="text/javascript">
        function SelectAllFields(CheckboxCtrl, IDString) {
            if (CheckboxCtrl.checked == true) {
                var i;
                for (i = 0; i < document.forms[0].elements.length; i++) {
                    if ((document.forms[0].elements[i].type == 'checkbox') && (document.forms[0].elements[i].name.indexOf(IDString) > -1)) {
                        document.forms[0].elements[i].checked = true;
                    }
                }
            }
            else {
                var i;
                for (i = 0; i < document.forms[0].elements.length; i++) {
                    if ((document.forms[0].elements[i].type == 'checkbox') &&
                    (document.forms[0].elements[i].name.indexOf(IDString) > -1)) {
                        document.forms[0].elements[i].checked = false;
                    }
                }
            }
        }
    </script>
</asp:Content>
